package com.bitejiuyeke.forum.dao;

import com.bitejiuyeke.forum.model.Message;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);

    /**
     *  根据用户id，查询未读消息数量
     * @param receiverUserId  用户id
     * @return
     */
    Integer selectUnreadCount(Long  receiverUserId);

    /**
     *  根据id，查询站内消息
     * @param receiveUserId
     * @return
     */
    List<Message> selectByReceiveUserId(Long receiveUserId);
}